package com.rover.system.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.grid.ViewField;

/**
 * 用户日志.
 *
 */
@Entity
@Table(name = "S_USERLOGS")
public class UserLog implements Serializable {
	
    private static final Long serialVersionUID = -2168102452771629922L;

	private Integer id;
    private User tuser;
    @ViewField(header = "登录用户", width = 150)
    private String loginName;
    
    @ViewField(header = "姓名", width = 150)
    private String name;
    
    @ViewField(header = "IP地址", width = 220)
    private String ipAddress;
    
    private Date operateDate;
    
    @ViewField(header = "操作日期", width = 250)
    private String operateDateView;
  
    @ViewField(header = "操作", width = 250)
    private String operation;
    
    public UserLog(){
    }
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY) 
    public Integer getId() {
        return id;
    }
   
    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID", nullable = false)
	public User getTuser() {
		return tuser;
	}

	public void setTuser(User tuser) {
		this.tuser = tuser;
	}
	
	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	public Date getOperateDate() {
		return operateDate;
	}

	public void setOperateDate(Date operateDate) {
		this.operateDate = operateDate;
	}

	public String getOperation() {
		return operation;
	}

	public void setOperation(String operation) {
		this.operation = operation;
	}

	@Transient
	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	@Transient
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Transient
	public String getOperateDateView() {
		return operateDateView;
	}

	public void setOperateDateView(String operateDateView) {
		this.operateDateView = operateDateView;
	}
	
	
}
